<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%
	request.setCharacterEncoding("UTF-8");
	response.setContentType("text/html;charset=UTF-8");
%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%
	String path = request.getContextPath();
%>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>嘉华金融后台管理中心</title>
	<script src="<%=path %>/admin/js/jquery.js"></script>
	<style type="text/css" media="screen">
		* {
			padding: 0;
			margin: 0;
		}
		.login-dialog {
			position: absolute;
			top: 0;
			left: 0;
			width: 100%;
			height: 100%;
			background: rgba(0,0,0,0.3);
			font-size: 16px;
		}
		.login-dialog-panel {
			position: relative;
			width: 400px;
			height: 250px;
			background: #fff;
			margin: 170px auto;

		}
		.login-dialog-panel>div {
			width: 80%;
			position: absolute;
			top: 50%;
			left: 50%;
			transform: translate(-50%,-50%);
			-moz-transform: translate(-50%,-50%);
			-webkit-transform: translate(-50%,-50%);
			-ms-transform: translate(-50%,-50%);
			-o-transform: translate(-50%,-50%);
		}
		.yan-code{
			margin-top: 20px;
		}
		.yan-code input {
			width: 100px;
			height: 20px;
			padding: 5px;
			border: 1px solid #b3afaf;
		}
		.yan-login-btn {
			margin-top: 40px;
			text-align: center;
		}
		.yan-login-btn button:hover {
			cursor: pointer;
		}
		.yan-login-btn button {
			width: 100%;
			height: 40px;
			background: #0ae;
			color: #fff;
			border: 0;
			border-radius: 4px;
		}
	</style>
</head>
<body>
	<div class="login-dialog">
		<div class="login-dialog-panel">
			<div>
				<p>已向手机号<span>${phone }</span>发送验证码</p>
				<div class="yan-code">
					<label>请输入验证码: </label><input id="mCode" type="text" >
				</div>
				<div class="yan-login-btn">
					<button onclick="validateMCode();" type="button">验证登录</button>
				</div>
			</div>
		</div>
	</div>
</body>
<script>
	var path="<%=path%>";
	function validateMCode(){
		var mCode=$("#mCode").val();
		if(mCode!=""){
			$.ajax({
	            url : path+"/devops/validateMCode.html",
	            data: {
	                mCode:mCode,
	            },
	            type : "POST",
	            datatype : "json",
	            async: false,
	            success : function(datas) {
	              var json =eval("(" + datas + ")");
	              flag=true; 
	              if(json.msg=="1"){
	            	  window.location=path+"/devops/index.html";
	              }else if(json.msg=="2"){
	                 alert("验证失败");
	             }
	           }
	       });
		}else{
			alert("验证码不能为空");
		}
	}
</script>
</html>